import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-10-16
 * 13:31
 */
public class Test {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int i=0;
        while(i<50){
            int m=sc.nextInt();//期中考试
            int f=sc.nextInt();//期末考试
            int r=sc.nextInt();//补考分数
            if(m==-1&&f==-1&&r==-1){
                break;
            }

            if(m==-1||f==-1){
                System.out.println("F");
                i++;
                break;
            }
            if(m+f>=80){
                System.out.println("A");
            }
            if(m+f>=65&&m+f<80){
                System.out.println("B");
            }
            if(m+f>=50&&m+f<65){
                System.out.println("C");
            }if(m+f>=30&&m+f<50){
                if(r>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
                i++;
                break;
            }
            if(f+m<30) {
                System.out.println("F");
            }

            i++;
        }
    }
}
